/* ==========================================================================
   Pinplaces — Header autenticado com dropdowns
   ==========================================================================

   Este arquivo contém APENAS as regras do header autenticado, com dropdowns
   para "Minha conta", "Notificações" e "Carrinho".

   Substitui integralmente a seção 2 de favoritos.css ("Header autenticado").
   Outras seções de favoritos.css permanecem inalteradas.

   NOTA DE DÉBITO TÉCNICO: todo este bloco é candidato a ser promovido ao
   pinplaces.css para ser reutilizado em todas as páginas logadas.
   ========================================================================== */


/* --------------------------------------------------------------------------
   A. Nav autenticada (container dos 5 itens)
   -------------------------------------------------------------------------- */

.site-header-authed .authed-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.authed-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--color-gray-700);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.authed-nav-link:hover {
  background: var(--color-gray-50);
  color: var(--color-chumbo);
}

.authed-nav-link.is-active {
  color: var(--color-brand-blue);
  background: var(--color-brand-blue-soft);
}

.authed-nav-link .icon {
  width: 18px;
  height: 18px;
  color: currentColor;
}

/* Avatar circular */
.authed-nav-account {
  padding-left: 6px;
}

.authed-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E7000B 0%, #B80A12 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  flex-shrink: 0;
}

.authed-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Chevron (seta do dropdown "Minha conta") */
.authed-nav-chevron {
  width: 14px !important;
  height: 14px !important;
  margin-left: 2px;
  color: var(--color-gray-500);
  transition: transform 0.2s ease;
}

.authed-dropdown.is-open > [data-dropdown-trigger] .authed-nav-chevron {
  transform: rotate(180deg);
}

/* Estado aberto do trigger */
.authed-dropdown.is-open > [data-dropdown-trigger] {
  background: var(--color-gray-50);
  color: var(--color-chumbo);
}

/* Ícone + badge (notif / cart) */
.authed-nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.authed-nav-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-brand-red, #ef4444);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px #ffffff;
}

/* Logout com separador */
.authed-nav-logout {
  margin-left: 8px;
  padding-left: 16px;
  position: relative;
}

.authed-nav-logout::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 20px;
  background: var(--color-gray-200);
}

.authed-nav-logout:hover {
  color: var(--color-brand-red, #ef4444);
  background: transparent;
}


/* --------------------------------------------------------------------------
   B. Dropdown — base (container + painel + animação)
   -------------------------------------------------------------------------- */

.authed-dropdown {
  position: relative;
}

.authed-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  min-width: 240px;
  padding: 6px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.authed-dropdown.is-open .authed-dropdown-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Setinha opcional indicando o trigger (triangulo branco no topo) */
.authed-dropdown-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 18px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-top: 1px solid var(--color-gray-200);
  border-left: 1px solid var(--color-gray-200);
  transform: rotate(45deg);
}


/* --------------------------------------------------------------------------
   C. Dropdown — header e footer compartilhados
   -------------------------------------------------------------------------- */

.authed-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--color-gray-100);
}

.authed-dropdown-header-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-gray-500);
}

.authed-dropdown-header-action {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-brand-blue);
  cursor: pointer;
  font-family: inherit;
}

.authed-dropdown-header-action:hover {
  text-decoration: underline;
}

.authed-dropdown-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.authed-dropdown-user {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-chumbo);
}

.authed-dropdown-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-chumbo);
}

.authed-dropdown-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--color-gray-100);
}

.authed-dropdown-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-brand-blue);
}

.authed-dropdown-footer-link:hover {
  text-decoration: underline;
}

.authed-dropdown-footer-link .icon {
  width: 12px;
  height: 12px;
}


/* --------------------------------------------------------------------------
   D. Dropdown Menu (minha conta) — lista simples de links
   -------------------------------------------------------------------------- */

.authed-dropdown-menu {
  width: 240px;
}

.authed-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.authed-dropdown-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-gray-700);
  transition: background 0.15s ease, color 0.15s ease;
}

.authed-dropdown-item .icon {
  width: 16px;
  height: 16px;
  color: var(--color-gray-500);
  transition: color 0.15s ease;
}

.authed-dropdown-item:hover {
  background: var(--color-brand-blue-soft);
  color: var(--color-brand-blue);
}

.authed-dropdown-item:hover .icon {
  color: var(--color-brand-blue);
}


/* --------------------------------------------------------------------------
   E. Dropdown Notificações
   -------------------------------------------------------------------------- */

.authed-dropdown-notifications {
  width: 360px;
  padding: 0;
  overflow: hidden;
}

.authed-notifications-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 380px;
  overflow-y: auto;
}

.authed-notification {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-gray-100);
  transition: background 0.15s ease;
}

.authed-notification:hover {
  background: var(--color-gray-50);
}

.authed-notifications-list li:last-child .authed-notification {
  border-bottom: 0;
}

.authed-notification-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
}

.authed-notification-icon .icon {
  width: 16px;
  height: 16px;
}

.authed-notification-icon-warning {
  background: #fffbeb;
  color: #b45309;
}

.authed-notification-icon-success {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.authed-notification-icon-info {
  background: var(--color-brand-blue-soft);
  color: var(--color-brand-blue);
}

.authed-notification-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.authed-notification-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-chumbo);
}

.authed-notification-time {
  font-size: 11px;
  color: var(--color-gray-500);
}

/* Estado "lido" — visual mais discreto */
.authed-notification-read .authed-notification-title {
  font-weight: 600;
  color: var(--color-gray-700);
}


/* --------------------------------------------------------------------------
   F. Dropdown Carrinho
   -------------------------------------------------------------------------- */

.authed-dropdown-cart {
  width: 380px;
  padding: 0;
  overflow: hidden;
}

.authed-cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.authed-cart-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-gray-100);
}

.authed-cart-list li:last-child .authed-cart-item {
  border-bottom: 0;
}

.authed-cart-item-media {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-gray-100);
}

.authed-cart-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.authed-cart-item-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.authed-cart-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-chumbo);
  line-height: 1.3;

  /* Limita a 1 linha */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.authed-cart-item-title:hover {
  color: var(--color-brand-blue);
}

.authed-cart-item-venue {
  font-size: 12px;
  color: var(--color-gray-700);
}

.authed-cart-item-meta {
  font-size: 11px;
  color: var(--color-gray-500);
}

.authed-cart-item-price-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
}

.authed-cart-item-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-chumbo);
  white-space: nowrap;
}

.authed-cart-item-remove {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-gray-500);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.authed-cart-item-remove:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.authed-cart-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--color-gray-50);
  border-top: 1px solid var(--color-gray-100);
}

.authed-cart-summary-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.authed-cart-summary-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-chumbo);
}

.authed-cart-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px 14px 14px;
}

.authed-cart-checkout {
  width: 100%;
  min-height: 42px;
  font-size: 13px;
  font-weight: 800;
  border-radius: var(--radius-md);
}

.authed-cart-view-all {
  justify-content: center;
  text-align: center;
}


/* --------------------------------------------------------------------------
   G. Media Queries
   -------------------------------------------------------------------------- */

/* ≤ 899px — esconde labels dos ícones (notif/cart/logout) */
@media (max-width: 899px) {
  .authed-nav-label-hidden-sm {
    display: none;
  }

  .authed-nav-icon-link {
    padding: 8px;
  }

  .authed-nav-logout {
    margin-left: 4px;
    padding-left: 12px;
  }
}

/* ≤ 767px — mobile */
@media (max-width: 767px) {
  /* "Minha conta" vira só avatar */
  .authed-nav-account .authed-nav-label,
  .authed-nav-account .authed-nav-chevron {
    display: none;
  }

  .authed-nav {
    gap: 2px;
  }

  /* Dropdowns ocupam largura quase total, evitam sangrar */
  .authed-dropdown-panel {
    min-width: 260px;
  }

  .authed-dropdown-notifications,
  .authed-dropdown-cart {
    width: calc(100vw - 24px);
    max-width: 360px;
  }

  /* Afasta dropdown do canto direito da viewport */
  .authed-dropdown-panel::before {
    right: 14px;
  }
}
